# Contributor: Robert Günzler <r@gnzler.io>
pkgname=cni-plugin-flannel
pkgver=1.0.0
pkgrel=3
pkgdesc="networking plugin, designed to work with flannel network fabric"
options="!check"
url="https://github.com/flannel-io/cni-plugin/"
arch="all"
license="Apache-2.0"
makedepends="go bash linux-headers"
source="$pkgname-$pkgver.tar.gz::https://github.com/flannel-io/cni-plugin/archive/v$pkgver.tar.gz"
builddir="$srcdir/cni-plugin-$pkgver"

build() {
	export VERSION="$pkgver"
	export GOARCH="$(go env GOARCH)"

	go mod tidy
	go mod vendor
	bash ./scripts/build_flannel.sh
}

package() {
	install -Dm755 -t "$pkgdir"/usr/libexec/cni dist/"flannel-$(go env GOARCH)"
}

sha512sums="4b75cfe2af334b974093e520657a92f69e2d20b43319d8425d7f024aef0ed5b923908a55fe146a561a5e3e83be9fda218e4317b29d9e58c2f414402c58f0fea6  cni-plugin-flannel-1.0.0.tar.gz"
